#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDialog>
#include <QToolBar>
#include <QDebug>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    QToolBar* tb = new QToolBar(this);
    QAction* a = new QAction("打开");
    tb->addAction(a);

    connect(a,&QAction::triggered,[=]()
    {
        QDialog dg(this);
        dg.resize(300,400);
        dg.exec();
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
    qDebug() << "按钮被按下";
}
